Support Temurin JDKs with JMOD files - #1149
Merged
Merged
Conversation
Copilot
AI
changed the title
[WIP] Add jmod option for Temurin distribution configuration
Support Temurin JDKs with JMOD files
Jul 28, 2026
brunoborges
marked this pull request as ready for review
July 28, 2026 22:12
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds an opt-in jmod input to support installing Temurin JDKs with JMOD files (needed because Temurin JDK 24+ no longer includes JMODs in the default JDK archive). It extends the Temurin installer to optionally download the matching Adoptium “jmods” artifact, merge it into the installed JDK, and cache that JDK separately.
Changes:
- Adds a new
jmodboolean input (action input + constants + wiring into installer options). - Extends Temurin installation to optionally download and merge the “jmods” image and cache it under a distinct toolcache folder suffix.
- Updates docs and adds focused Temurin installer test coverage for the new behavior.
Show a summary per file
| File | Description |
|---|---|
| src/setup-java.ts | Reads jmod input and passes it through installer options. |
| src/distributions/temurin/installer.ts | Implements optional JMOD download/merge and toolcache folder suffixing. |
| src/distributions/base-models.ts | Adds optional jmod?: boolean to installer options model. |
| src/constants.ts | Adds INPUT_JMOD constant. |
| action.yml | Exposes jmod as a supported action input. |
| docs/advanced-usage.md | Documents jmod: true usage for Temurin. |
| tests/distributors/temurin-installer.test.ts | Adds tests for image_type=jmods, toolcache folder naming, and JMOD merge path. |
| dist/setup/index.js | Updates compiled distribution output for setup action. |
| dist/cleanup/index.js | Updates compiled distribution output for cleanup action constants. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 7/9 changed files
- Comments generated: 2
- Review effort level: Low
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e7d8c581-2d14-4ccc-aeca-afc0f3b0c2bc
Use platform-aware path construction for the JMOD copy and cache assertions so the Windows test expects backslash-normalized paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
brunoborges
force-pushed
the
copilot/support-temurin-jmod-distribution
branch
from
July 28, 2026 22:25
eeae934 to
5573c3d
Compare
Contributor
There was a problem hiding this comment.
Review details
Comments suppressed due to low confidence (2)
src/distributions/temurin/installer.ts:180
- The JMODs archive extracted from Adoptium uses a JDK-like top-level directory that itself contains a
jmods/subdirectory. Copying the extracted root directory into${javaHome}/jmodswill nest paths (e.g.,${javaHome}/jmods/<extracted-root>/jmods/...) rather than placing the.jmodfiles directly under${javaHome}/jmods.
Copy the jmods directory from within the extracted artifact (and account for macOS Contents/Home) instead of copying the artifact root.
const jmodsDirectory = path.join(
extractedJmodsPath,
fs.readdirSync(extractedJmodsPath)[0]
);
fs.cpSync(jmodsDirectory, path.join(javaHome, 'jmods'), {recursive: true});
tests/distributors/temurin-installer.test.ts:520
- This test asserts the
fs.cpSyncsource as the extracted artifact root (.../jdk-25-jmods). With the intended behavior of merging JMODs into the JDK, the copy source should be thejmodsdirectory inside the extracted artifact (andContents/Home/jmodson macOS). Update the expectation to match the correct copy semantics.
);
expect(spyCopySync).toHaveBeenCalledWith(
path.join('/tmp/extracted-jmods', 'jdk-25-jmods'),
process.platform === 'darwin'
? path.join('/tmp/extracted', 'jdk-25', 'Contents', 'Home', 'jmods')
: path.join('/tmp/extracted', 'jdk-25', 'jmods'),
{recursive: true}
- Files reviewed: 7/8 changed files
- Comments generated: 0 new
- Review effort level: Low
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Temurin JDK 24+ excludes JMOD files from its default archive. This adds opt-in installation of Adoptium's matching JMOD artifact through the existing
java-packageinput.java-package: jdk+jmodsvariant.jdk+jmodsfor unsupported distributions.Related issue:
#804
Check list:
npm run checklocally (format, lint, build, test) and all checks pass.